package com.ly.flowable;

import org.flowable.engine.ProcessEngine;
import org.flowable.engine.ProcessEngineConfiguration;
import org.flowable.engine.impl.cfg.StandaloneProcessEngineConfiguration;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * @Author LY
 * @create 2024/1/12 16:46
 * @Description flowable测试类
 */
@SpringBootTest(classes = FlowableApplication.class)
public class FlowableDemo {

    @Test
    public void createDatabase(){
        // 手动创建表
        ProcessEngineConfiguration cfg = new StandaloneProcessEngineConfiguration()
                .setJdbcUrl("jdbc:mysql://121.41.17.192:8306/flowable?characterEncoding=UTF-8&nullCatalogMeansCurrent=true")
                .setJdbcUsername("root")
                .setJdbcPassword("ly_root_202311")
                .setJdbcDriver("com.mysql.cj.jdbc.Driver")
                .setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);
        ProcessEngine processEngine = cfg.buildProcessEngine();
        System.out.println("processEngine:" + processEngine);
    }
}
